package com.spring.api.web.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.spring.api.web.service.BuzWechatService;
import com.spring.security.core.annotation.OaUserPermission;
import com.spring.security.web.controller.BaseController;
import com.spring.security.web.model.BaseResult;
import com.wordnik.swagger.annotations.ApiOperation;

/**
 * 微信企业号相关接口
 * @author wojunyu
 *
 */
@Controller
//@RestController
@RequestMapping(value = "/buzWechat")
public class BuzWechatController extends BaseController{ 
	
	@Resource private BuzWechatService buzWechatService;
	
	@OaUserPermission(value="/buzWechat/notice")
	@RequestMapping(value="/notice", method = RequestMethod.GET)
    @ApiOperation(value = "会议第一次通知", httpMethod = "GET", response = Object.class, notes = "会议第一次通知",produces = "application/json; charset=utf-8")
	@ResponseBody
    public Object notice(String callback,HttpServletRequest request,HttpServletResponse response) throws Exception{
		 BaseResult ret = buzWechatService.notice();
		 return buildResultInfo(ret,callback);
    }
	
	
//	@OaUserPermission(value="/buzWechat/notice")
	@RequestMapping(value="/logNotice", method = RequestMethod.GET)
	@ResponseBody
    public Object logNotice(@RequestParam String ids,String callback,HttpServletRequest request,HttpServletResponse response) throws Exception{
		 BaseResult ret = buzWechatService.sendNotice(ids);
		 return buildResultInfo(ret,callback);
    }
}
